<!-- 机构资金数据统计 -->
<template>
  <div>
    <el-card v-if="show == 'table'">
      <el-row>
        <el-form ref="form" :model="searchDto" inline label-suffix=":">
          <el-form-item label="关键字" prop="assistEquName">
            <el-input
              v-model="searchDto.keywords"
              placeholder="请输入关键字"
              style="width: 250px"
            ></el-input>
          </el-form-item>
          <el-form-item>
            <el-button icon="el-icon-search" type="primary" @click="search"
              >查询</el-button
            >
          </el-form-item>
          <el-form-item>
            <el-button icon="el-icon-s-open" type="primary" @click="clear"
              >重置</el-button
            >
          </el-form-item>
        </el-form>
      </el-row>

      <page-table
        ref="recovery"
        :page-data="pageData"
        :loading="loading"
        :do-get-page-data="getPageData"
      >
        <el-table-column type="index" label="编号" width="80" align="center" />
        <el-table-column
          prop="institutionName"
          label="机构名称"
          show-overflow-tooltip
          align="center"
        />
        <el-table-column
          prop="courseCount"
          label="课程数量"
          show-overflow-tooltip
          align="center"
        >
          <template slot-scope="scope">
            <a
              style="color: #409eff; cursor: pointer"
              @click="courseColumn(scope.row)"
            >
              {{ scope.row.courseCount }}
            </a>
          </template>
        </el-table-column>
        <el-table-column prop="stuCount" label="学员个数" align="center">
          <template slot-scope="scope">
            <a
              style="color: #409eff; cursor: pointer"
              @click="studentColumn(scope.row)"
            >
              {{ scope.row.stuCount }}
            </a>
          </template>
        </el-table-column>
        <el-table-column prop="teacherCount" label="教师" align="center" />
      </page-table>
    </el-card>
  </div>
</template>
  <script>
export default {
  name: "fundStatistics",
  components: {},
  data() {
    return {
      show: "table",
      disDetail: {},
      disEdit: {},
      pageData: {},
      loading: false,
      searchDto: {
        pageIndex: null,
        pageSize: null,
        keywords: null,
      },
      switchValue: true,
    };
  },
  mounted() {
    this.getPageData();
  },
  methods: {
    getInfo() {
      this.API.deleteRecoveryInstitutionById().then((res) => {
        this.searchDto.institutionId = res.data.id;
        this.getPageData();
      });
    },
    // 获取分页数据
    getPageData(val) {
      let tem = Object.assign(this.searchDto, val);
      this.API.getFundPageList(tem).then((ret) => {
        console.log("getFundPageList:", ret.data);
        this.pageData = ret.data;
      });
    },

    // 查询
    search() {
      this.getPageData({ pageIndex: 1 });
    },

    //清空
    clear() {
      this.$refs.form.resetFields();
      this.getPageData();
    },
    // 课程
    courseColumn({institutionId}) {
      console.log('courseColumn:',institutionId);
      this.$router.push({ name: "courseInfo", query: { institutionId } });
    },
    // 学员个数
    studentColumn({institutionId}) {
      console.log('studentColumn:',institutionId);
      this.$router.push({ name: "studentInfo", query: {institutionId } });
    },
  },
};
</script>
<style scoped lang="scss"></style>
        